﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.ShemaKnjizenjaRobno"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ShemaKnjizenjaRobnoEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// ComboBox for the IDDokumentTip property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDDokumentTip;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDDokumentTip property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDDokumentTipLabel;
		
		/// <summary>
		/// ComboBox for the IDKolonaZaPrebacivanje property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDKolonaZaPrebacivanje;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDKolonaZaPrebacivanje property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDKolonaZaPrebacivanjeLabel;
		
		/// <summary>
		/// TextBox for the KontoZaPrebacivanje property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKontoZaPrebacivanje;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the KontoZaPrebacivanje property.
		/// </summary>
		protected System.Windows.Forms.Label uxKontoZaPrebacivanjeLabel;
		
		/// <summary>
		/// ComboBox for the IDVrstaFinDokumenta property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDVrstaFinDokumenta;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDVrstaFinDokumenta property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDVrstaFinDokumentaLabel;
		
		/// <summary>
		/// CheckBox for the DugIliPot property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxDugIliPot;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DugIliPot property.
		/// </summary>
		protected System.Windows.Forms.Label uxDugIliPotLabel;
		
		/// <summary>
		/// TextBox for the RedBr property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxRedBr;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the RedBr property.
		/// </summary>
		protected System.Windows.Forms.Label uxRedBrLabel;
		
		/// <summary>
		/// CheckBox for the SklRobeSklPrema property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxSklRobeSklPrema;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the SklRobeSklPrema property.
		/// </summary>
		protected System.Windows.Forms.Label uxSklRobeSklPremaLabel;
		
		/// <summary>
		/// CheckBox for the Maloprodaja property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxMaloprodaja;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Maloprodaja property.
		/// </summary>
		protected System.Windows.Forms.Label uxMaloprodajaLabel;
		#endregion
		
		#region Main entity
		private Entities.ShemaKnjizenjaRobno _ShemaKnjizenjaRobno;
		/// <summary>
		/// Gets or sets the <see cref="Entities.ShemaKnjizenjaRobno"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.ShemaKnjizenjaRobno"/> instance.</value>
		public Entities.ShemaKnjizenjaRobno ShemaKnjizenjaRobno
		{
			get {return this._ShemaKnjizenjaRobno;}
			set
			{
				this._ShemaKnjizenjaRobno = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDDokumentTip.DataBindings.Clear();
			this.uxIDDokumentTip.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDDokumentTip", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDKolonaZaPrebacivanje.DataBindings.Clear();
			this.uxIDKolonaZaPrebacivanje.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDKolonaZaPrebacivanje", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKontoZaPrebacivanje.DataBindings.Clear();
			this.uxKontoZaPrebacivanje.DataBindings.Add("Text", this.uxBindingSource, "KontoZaPrebacivanje", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDVrstaFinDokumenta.DataBindings.Clear();
			this.uxIDVrstaFinDokumenta.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDVrstaFinDokumenta", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDugIliPot.DataBindings.Clear();
			this.uxDugIliPot.DataBindings.Add("Checked", this.uxBindingSource, "DugIliPot", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxRedBr.DataBindings.Clear();
			this.uxRedBr.DataBindings.Add("Text", this.uxBindingSource, "RedBr", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxSklRobeSklPrema.DataBindings.Clear();
			this.uxSklRobeSklPrema.DataBindings.Add("Checked", this.uxBindingSource, "SklRobeSklPrema", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxMaloprodaja.DataBindings.Clear();
			this.uxMaloprodaja.DataBindings.Add("Checked", this.uxBindingSource, "Maloprodaja", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="ShemaKnjizenjaRobnoEditControlBase"/> class.
		/// </summary>
		public ShemaKnjizenjaRobnoEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_ShemaKnjizenjaRobno != null) _ShemaKnjizenjaRobno.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxIDDokumentTip = new System.Windows.Forms.ComboBox();
			uxIDDokumentTipLabel = new System.Windows.Forms.Label();
			this.uxIDKolonaZaPrebacivanje = new System.Windows.Forms.ComboBox();
			uxIDKolonaZaPrebacivanjeLabel = new System.Windows.Forms.Label();
			this.uxKontoZaPrebacivanje = new System.Windows.Forms.TextBox();
			uxKontoZaPrebacivanjeLabel = new System.Windows.Forms.Label();
			this.uxIDVrstaFinDokumenta = new System.Windows.Forms.ComboBox();
			uxIDVrstaFinDokumentaLabel = new System.Windows.Forms.Label();
			this.uxDugIliPot = new System.Windows.Forms.CheckBox();
			uxDugIliPotLabel = new System.Windows.Forms.Label();
			this.uxRedBr = new System.Windows.Forms.TextBox();
			uxRedBrLabel = new System.Windows.Forms.Label();
			this.uxSklRobeSklPrema = new System.Windows.Forms.CheckBox();
			uxSklRobeSklPremaLabel = new System.Windows.Forms.Label();
			this.uxMaloprodaja = new System.Windows.Forms.CheckBox();
			uxMaloprodajaLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxIDDokumentTipLabel
			//
			this.uxIDDokumentTipLabel.Text = "IDDokumentTip:";
			this.uxIDDokumentTipLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDDokumentTipLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDDokumentTipLabel);			
			//
			// uxIDDokumentTip
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDDokumentTip);
			this.uxIDDokumentTip.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDDokumentTip);
			//
			// uxIDKolonaZaPrebacivanjeLabel
			//
			this.uxIDKolonaZaPrebacivanjeLabel.Text = "IDKolonaZaPrebacivanje:";
			this.uxIDKolonaZaPrebacivanjeLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxIDKolonaZaPrebacivanjeLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKolonaZaPrebacivanjeLabel);			
			//
			// uxIDKolonaZaPrebacivanje
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKolonaZaPrebacivanje);
			this.uxIDKolonaZaPrebacivanje.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxIDKolonaZaPrebacivanje);
			//
			// uxKontoZaPrebacivanjeLabel
			//
			this.uxKontoZaPrebacivanjeLabel.Text = "KontoZaPrebacivanje:";
			this.uxKontoZaPrebacivanjeLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxKontoZaPrebacivanjeLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKontoZaPrebacivanjeLabel);			
			//
			// uxKontoZaPrebacivanje
			//
			this.uxKontoZaPrebacivanje.Width = 250;
			this.uxKontoZaPrebacivanje.MaxLength = 9;
			//this.uxTableLayoutPanel.Controls.Add(this.uxKontoZaPrebacivanje);
			this.uxKontoZaPrebacivanje.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxKontoZaPrebacivanje);
			//
			// uxIDVrstaFinDokumentaLabel
			//
			this.uxIDVrstaFinDokumentaLabel.Text = "IDVrstaFinDokumenta:";
			this.uxIDVrstaFinDokumentaLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxIDVrstaFinDokumentaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDVrstaFinDokumentaLabel);			
			//
			// uxIDVrstaFinDokumenta
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDVrstaFinDokumenta);
			this.uxIDVrstaFinDokumenta.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxIDVrstaFinDokumenta);
			//
			// uxDugIliPotLabel
			//
			this.uxDugIliPotLabel.Text = "DugIliPot:";
			this.uxDugIliPotLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxDugIliPotLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDugIliPotLabel);			
			//
			// uxDugIliPot
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDugIliPot);
			this.uxDugIliPot.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxDugIliPot);
			//
			// uxRedBrLabel
			//
			this.uxRedBrLabel.Text = "RedBr:";
			this.uxRedBrLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxRedBrLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxRedBrLabel);			
			//
			// uxRedBr
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxRedBr);
			this.uxRedBr.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxRedBr);
			//
			// uxSklRobeSklPremaLabel
			//
			this.uxSklRobeSklPremaLabel.Text = "SklRobeSklPrema:";
			this.uxSklRobeSklPremaLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxSklRobeSklPremaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxSklRobeSklPremaLabel);			
			//
			// uxSklRobeSklPrema
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxSklRobeSklPrema);
			this.uxSklRobeSklPrema.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxSklRobeSklPrema);
			//
			// uxMaloprodajaLabel
			//
			this.uxMaloprodajaLabel.Text = "Maloprodaja:";
			this.uxMaloprodajaLabel.Location = new System.Drawing.Point(3, 208);
			this.Controls.Add(this.uxMaloprodajaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxMaloprodajaLabel);			
			//
			// uxMaloprodaja
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxMaloprodaja);
			this.uxMaloprodaja.Location = new System.Drawing.Point(160, 208);
			this.Controls.Add(this.uxMaloprodaja);
			//
			// uxIDDokumentTip
			//				
			this.uxIDDokumentTip.DisplayMember = "Naziv";	
			this.uxIDDokumentTip.ValueMember = "ID";	
			//
			// uxIDKolonaZaPrebacivanje
			//				
			this.uxIDKolonaZaPrebacivanje.DisplayMember = "Kolona";	
			this.uxIDKolonaZaPrebacivanje.ValueMember = "ID";	
			//
			// uxIDVrstaFinDokumenta
			//				
			this.uxIDVrstaFinDokumenta.DisplayMember = "Naziv";	
			this.uxIDVrstaFinDokumenta.ValueMember = "ID";	
			// 
			// ShemaKnjizenjaRobnoEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "ShemaKnjizenjaRobnoEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.DokumentTip> _IDDokumentTipList;
		
		/// <summary>
		/// The ComboBox associated with the IDDokumentTip property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.DokumentTip> IDDokumentTipList
		{
			get {return _IDDokumentTipList;}
			set 
			{
				this._IDDokumentTipList = value;
				this.uxIDDokumentTip.DataSource = null;
				this.uxIDDokumentTip.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDDokumentTipList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDDokumentTip property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDDokumentTipList
		{
			get { return _allowNewItemInIDDokumentTipList;}
			set
			{
				this._allowNewItemInIDDokumentTipList = value;
				this.uxIDDokumentTip.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.ShemaKnjizenjeNazivKolona> _IDKolonaZaPrebacivanjeList;
		
		/// <summary>
		/// The ComboBox associated with the IDKolonaZaPrebacivanje property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.ShemaKnjizenjeNazivKolona> IDKolonaZaPrebacivanjeList
		{
			get {return _IDKolonaZaPrebacivanjeList;}
			set 
			{
				this._IDKolonaZaPrebacivanjeList = value;
				this.uxIDKolonaZaPrebacivanje.DataSource = null;
				this.uxIDKolonaZaPrebacivanje.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDKolonaZaPrebacivanjeList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDKolonaZaPrebacivanje property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKolonaZaPrebacivanjeList
		{
			get { return _allowNewItemInIDKolonaZaPrebacivanjeList;}
			set
			{
				this._allowNewItemInIDKolonaZaPrebacivanjeList = value;
				this.uxIDKolonaZaPrebacivanje.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.VrstaFinDokumenta> _IDVrstaFinDokumentaList;
		
		/// <summary>
		/// The ComboBox associated with the IDVrstaFinDokumenta property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.VrstaFinDokumenta> IDVrstaFinDokumentaList
		{
			get {return _IDVrstaFinDokumentaList;}
			set 
			{
				this._IDVrstaFinDokumentaList = value;
				this.uxIDVrstaFinDokumenta.DataSource = null;
				this.uxIDVrstaFinDokumenta.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDVrstaFinDokumentaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDVrstaFinDokumenta property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDVrstaFinDokumentaList
		{
			get { return _allowNewItemInIDVrstaFinDokumentaList;}
			set
			{
				this._allowNewItemInIDVrstaFinDokumentaList = value;
				this.uxIDVrstaFinDokumenta.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
